import { ref, computed } from 'vue'

export const useCounter = () => {
  const count = ref(0)
  const increment = () => count.value++
  const decrement = () => count.value--
  const isOdd = computed(() => count.value % 2 !== 0)

  return {
    count,
    increment,
    decrement,
    isOdd
  }
}
